/*
 * @Author: wuzhen
 * @Date: 2019-12-03 14:06:15
 * @LastEditors  : wuzhen
 * @LastEditTime : 2020-01-11 10:52:02
 * @Description: api接口文件
 */
import http from "./http.js";

import mock from "@/assets/mock/mock";

// 获取菜单权限
export const getPermission = () => mock.permission();
// 获取角色
export const getRoles = () => mock.roles();

// 用户登录
export const login = data =>
  http("/pipes/userinfo/login", { bean: JSON.stringify(data) }, "post");
// 用户密码修改
export const changePwd = data =>
  http("/pipes/userinfo/changepwd", { bean: JSON.stringify(data) }, "post");
// 用户退出
export const LoginOut = data => fetch("/api/admin/logout", data, "get");
// 获取菜单
export const getUserInfo = data => http("/pipes/dync/mydata", data, "get");

// 系统权限-账号管理
export const getAdminList = data => http("/pipes/userinfo/query", data, "get");
// 系统权限-账号管理-新增
export const addAdmin = data => http("/pipes/userinfo/create", data, "post");
// 系统权限-账号管理-修改
export const editAdmin = data => http("/pipes/userinfo/update", data, "post");
// 系统权限-账号管理-修改角色
export const editAdminRole = data =>
  http("/pipes/role/upduserole", data, "post");
// 系统权限-账号管理-密码重置
export const resetAdminPassword = data =>
  http("/pipes/userinfo/resetPwd", data, "post");
// 系统权限-角色管理
export const getRoleList = data => http("/pipes/role/query", data, "get");
// 系统权限-角色管理-新增
export const addRole = data => http("/pipes/role/create", data, "post");
// 系统权限-角色管理-修改
export const editRole = data => http("/pipes/role/update", data, "post");
// 系统权限-角色管理-角色所属权限
export const getQryoption = data => http("/pipes/role/qryoption", data, "get");
// 系统权限-角色管理-修改权限
export const editQryoption = data =>
  http("/pipes/role/updoption", data, "post");

// 概况-统计
export const getmonitorData = data =>
  http("/pipes/monitoross/queryDataList", data, "get");
// 概况-用户增长
export const getmonitorOnline = data =>
  http("/pipes/monitoross/userOnline", data, "get");

// 用户管理-列表
export const getUserList = data =>
  http("/pipes/useross/queryUserList", data, "get");
// 用户管理-启用、停用
export const updateStatus = data =>
  http("/pipes/useross/updateStatus", data, "post");

// 用户管理-注销账号
export const destroyAccount = data =>
  http("/pipes/useross/destroyAccount", data, "post");

// 用户管理-重置密码
export const resetUserPwd = data =>
  http("/pipes/useross/resetUserPwd", data, "post");

// 好友管理-删除好友
export const delFriend = data =>
  http("/pipes/useross/delFriend", data, "post");

// 用户管理-强制下线
export const updateOnlinestatus = data =>
  http("/pipes/useross/updateOnlinestatus", data, "post");

// 用户管理-详情
export const getUserDetail = data =>
  http("/pipes/useross/findUserDetail", data, "get");

// 用户管理-好友管理
export const getUserFriendShip = data =>
  http("/pipes/useross/findFriendShip", data, "get");

// 用户管理-是否拉黑
export const updateBlackList = data =>
  http("/pipes/useross/updateBlackList", data, "post");

// 单聊记录-列表
export const getMessageRecordList = data =>
  http("/pipes/messageoss/queryMessageRecordList", data, "get");
// 单聊记录-删除   群聊
export const delMessageRecord = data =>
  http("/pipes/messageoss/delMessageRecord", data, "post");

// 群组管理-列表
export const getGroupList = data =>
  http("/pipes/groupdetailoss/queryGroupList", data, "get");

// 群组管理-列表-移除成员
export const removeUserFromGroup = data =>
  http("/pipes/groupdetailoss/removeUserFromGroup", data, "post");

// 群组管理-成员管理
export const getGroupUser = data =>
  http("/pipes/groupdetailoss/findGroupUser", data, "get");
// 群组管理-聊天记录
export const getGroupMsg = data =>
  http("/pipes/groupdetailoss/findUserGroupMsg", data, "get");
// 群组管理-解散群
export const updateGroupStatus = data =>
  http("/pipes/groupdetailoss/updateGroupStatus", data, "post");

// 系统公告-列表
export const getNoticeList = data =>
  http("/pipes/systemnoticeoss/queryNoticeList", data, "get");
// 系统公告-新增
export const addNotice = data =>
  http("/pipes/systemnoticeoss/createNotice", data, "post");
// 系统公告-关闭
export const closeNotice = data =>
  http("/pipes/systemnoticeoss/updateStatus", data, "post");

// 举报管理-列表
export const getComplaintList = data =>
  http("/pipes/complaintrecordoss/queryComplaintList", data, "get");

// 举报管理-举报详细列表
export const findComplaintDetail = data =>
  http("/pipes/complaintrecordoss/findComplaintDetail", data, "get");

